package com.ATMgui;

import com.lovo.util.Util;

import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class FindMoney extends JPanel implements ActionListener {
    private Icon sureBtn = Util.getIcon("/image/buttonSure.jpg");
    private JTextField textField1;
    private JButton sure;
    private ATM frame;

    public JTextField getTextField1() {
        return textField1;
    }

    public void setTextField1(JTextField textField1) {
        this.textField1 = textField1;
    }

    public FindMoney(ATM frame) {
        this.frame = frame;
        this.setLayout(null);

        //shurukuang
        textField1 = new JTextField();
        textField1.setBounds(250, 150, 250, 30);
        this.add(textField1);

        this.setOpaque(false);
        sure = new JButton(sureBtn);
        sure.setBounds(200, 320, 100, 20);
        this.add(sure);
        sure.addActionListener(this);
    }

    @Override
    public void actionPerformed(ActionEvent e) {
        if (e.getSource() == sure) {
            frame.switchPanel("菜单");
        }
    }
}
